package com.seven.sevenchat.service;

import com.seven.sevenchat.VO.UserVO;
import com.seven.sevenchat.model.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author Dell
* @description 针对表【user】的数据库操作Service
* @createDate 2024-12-12 20:58:33
*/
public interface UserService extends IService<User> {
    /**
     * 用户注册
     *
     * @param userName 用户账号
     * @param userPassword 用户密码
     * @param checkPassword 确认密码
     * @return 新的用户id
     */
    long userRegister(String userName,String userPassword,String checkPassword,String planetCode);

    /**
     * 用户登录
     *
     * @param userName     用户账号
     * @param userPassword 用户密码
     * @param request 请求
     * @return
     */
    User userLogin(String userName, String userPassword, HttpServletRequest request);

    /**
     * 用户注销
     * @param request
     * @return
     */
    Integer userLogout(HttpServletRequest request);

    //把用户脱敏相关代码提取出来
    User getSafetyUser(User user);

    /**
     *   根据标签搜索用户。
     * @param tagNameList  用户要搜索的标签
     * @return
     */
    List<User> searchUsersByTags(List<String> tagNameList);

    List<User> searchUsersByTags2(List<String> tagNameList);

    int updateUser(User user, User loginUser);

    User getLogininUser(HttpServletRequest request);

    boolean isAdmin(HttpServletRequest request);

    boolean isAdmin(User user);

    List<User> matchUsers(long num, User loginUser);

    void geoAddUser();

    List<UserVO> searchNearUser(Integer radius, HttpServletRequest request);
}
